package com.leo.springbootmultithreadbasic.communication.threadlocal;

/**
 * @author Leo
 * @version V1.0
 */
public class Storage {

    private Storage() {
        throw new UnsupportedOperationException();
    }

    // 模拟一个数据存储容器，ThreadLocal设置默认值
    public static final ThreadLocal<String> THREAD_LOCAL_STORAGE = ThreadLocal.withInitial(() -> "默认值");

    /**
     * remove data
     */
    public static void remove() {
        THREAD_LOCAL_STORAGE.remove();
    }

}
